package com.rakuten.api.mule.transformers;

import org.mule.api.MuleMessage;
import org.mule.api.transformer.TransformerException;
import org.mule.api.transport.PropertyScope;
import org.mule.transformer.AbstractMessageTransformer;


import com.rakuten.api.mule.CommonFlowConstants;
import com.rakuten.api.mule.model.Product;



public class PrepareProductObject extends AbstractMessageTransformer {
	@Override
	public Object transformMessage(MuleMessage message, String outputEncoding)
			throws TransformerException {

		try {
			Product product = (Product)message.getProperty(CommonFlowConstants.ORIGINAL_PAYLOAD, PropertyScope.SESSION);
			return product;
		} catch (Exception ex) {
			throw new TransformerException(this, ex);
		}
	}
}

